<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/tld/c.tld"%>
<div class="pagelist">
	<a title="Total record">&nbsp;<b>${pager.totalPage }</b>
	</a>
	<c:forEach begin="1" end="${pager.totalPage}" var="page">
		<c:if test="${page<=5 }">
			<a href="javascript:jumpPage(${page })" class="${page==pager.currentPage?'aBlob':'' }">${page }</a>&nbsp;
   		</c:if>
	</c:forEach>
	<a href="javascript:nextPage()">下一页</a>&nbsp;<a
		href="javascript:jumpPage(${pager.totalPage})">尾页</a>
	<form name="pageForm" action="index.do" style="display: none">
		<input name="currentPage" id="currentPage"
			value="${pager.currentPage }"> <input name="title"
			value="${title }">
	</form>
</div>
<style>
	.aBlob{
		font-weight:bold;
	}
</style>
<script>
	function nextPage() {
		var curr = ${pager.currentPage};
		var total = ${pager.totalPage};
		if (curr >= total) {
			return false;
		}
		var next = ${pager.currentPage} + 1;
			callPager(next);
		}
		function jumpPage(jump) {
			var totalPage = ${pager.totalPage};
			if (jump > totalPage || jump < 1) {
				return false;
			}
			callPager(jump);
		}
		function callPager(page) {
			$("#currentPage").val(page);
			document.pageForm.submit();
			return false;
		}
</script>